﻿package javase.socket.client;

import java.io.*;
import java.net.*;

public class UDPClient {
	public static void main(String[] args) {
		byte[] b = new byte[1024];
		try {
			DatagramSocket ds = new DatagramSocket(7777);
			DatagramPacket dp = new DatagramPacket(b, b.length);
			ds.receive(dp);
			System.out.println(new String(dp.getData()));
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (SocketException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
